$('#top-btn,#photographs,#last-article,#introduce,#go-top,#go-banner').click(function () {
	if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') && location.hostname == this.hostname) {
		var $target = $(this.hash);
		$target = $target.length && $target || $('[id=' + this.hash.slice(1) + ']');
		if ($target.length) {
			var targetOffset = $target.offset().top;
			$('html,body').animate({
				scrollTop: targetOffset
			}, 1000);
			return false;
		}
	}
});


$(".header span").click(function () {
    // console.log($(this)[0].innerHTML);
    var currClick = $(this)[0].innerHTML;
    $(this).siblings('span').removeClass("active");
    $(this).addClass("active");
});


$(".list-item .item").mouseenter(function () {
	$(this).children(".mask").fadeIn("slow")
});
$(".list-item .item").mouseleave(function () {
	$(this).children(".mask").fadeOut("slow")
});

$(function () {
	var docHeight = $(document).scrollTop();
	$(window).scroll(function () {
		var scrollY = $(document).scrollTop(); // 获取垂直滚动的距离，即滚动了多少
		console.log(scrollY);
		if (scrollY > 120) {
			$("#top-btn").hide(500);
			$("#fade-btn").show(100);
		} else {
			$("#top-btn").show(500);
			$("#fade-btn").hide(500);
		}
		if (scrollY > 870) {
			$('#header-bar').fadeIn(300);
			$('#go-top').fadeIn();
		} else {
			$('#go-top,#header-bar').fadeOut(300);
			$('#go-top').fadeOut();
		}
	});
})


